<html>
<head><meta charset="utf-8"><title>replacing mir-opt with UI · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html">replacing mir-opt with UI</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163969414"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/163969414" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> eddyb <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#163969414">(Apr 23 2019 at 07:50)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> and I are considering <code>-Zprint-mir-{before,after]=Pass</code> that emits something like e.g. <a href="https://github.com/rust-lang/rust/blob/master/src/test/mir-opt/inline-closure.rs#L15" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/test/mir-opt/inline-closure.rs#L15">https://github.com/rust-lang/rust/blob/master/src/test/mir-opt/inline-closure.rs#L15</a> (in that case, you'd pass <code>-Zprint-mir-after=Inline</code>, maybe also filtering by <code>foo</code>, but the syntax for that is bikesheddy)</p>
<p>then we can use UI tests and <code>--bless</code> instead of the <code>mir-opt</code> mode in <code>compiletest</code> (which is really slow, see <a href="https://github.com/rust-lang/rust/issues/58485#issuecomment-485673688" target="_blank" title="https://github.com/rust-lang/rust/issues/58485#issuecomment-485673688">https://github.com/rust-lang/rust/issues/58485#issuecomment-485673688</a>)</p>
<p>cc <span class="user-mention" data-user-id="116009">@nikomatsakis</span> <span class="user-mention" data-user-id="116083">@pnkfelix</span></p>



<a name="163994824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/163994824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#163994824">(Apr 23 2019 at 14:30)</a>:</h4>
<p>In theory don’t the mir-opt mode tests allow one to omit statements, which this would not? That may be or may not be a net boon.</p>



<a name="163995834"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/163995834" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#163995834">(Apr 23 2019 at 14:42)</a>:</h4>
<p>it'll be noisier, but the fact that we can use <code>--bless</code> makes this not a pain point for unrelated changes.</p>



<a name="164032667"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032667" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032667">(Apr 23 2019 at 21:44)</a>:</h4>
<p>I am all in favor of leveraging UI tests more</p>



<a name="164032670"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032670" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032670">(Apr 23 2019 at 21:44)</a>:</h4>
<p>and having fewer random modes</p>



<a name="164032686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032686">(Apr 23 2019 at 21:44)</a>:</h4>
<p>my main concern though is that if the output has <em>too much</em> crap</p>



<a name="164032698"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032698" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032698">(Apr 23 2019 at 21:44)</a>:</h4>
<p>it might be hard to know what the <em>important</em> bits are?</p>



<a name="164032716"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032716" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032716">(Apr 23 2019 at 21:45)</a>:</h4>
<p>i.e., you see some diffs, but did you disable the optimization or not?</p>



<a name="164032722"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032722" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032722">(Apr 23 2019 at 21:45)</a>:</h4>
<p>but maybe we can use <code>//~ ERROR</code> to help with that?</p>



<a name="164032728"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032728" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032728">(Apr 23 2019 at 21:45)</a>:</h4>
<p>not sure how :)</p>



<a name="164032819"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032819" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032819">(Apr 23 2019 at 21:46)</a>:</h4>
<p>I do like the general model of UI tests, where we have <code>--bless</code> that needs to be reviewed, but we use <code>//~ ERROR</code> to try to set a "lower bar" to how much you can behavior you can bless without any manual intervention :)</p>



<a name="164032827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032827">(Apr 23 2019 at 21:46)</a>:</h4>
<p>so I guess the question is what form that lower bar might take for mir-opt</p>



<a name="164032842"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/replacing%20mir-opt%20with%20UI/near/164032842" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/replacing.20mir-opt.20with.20UI.html#164032842">(Apr 23 2019 at 21:46)</a>:</h4>
<p>I'd be ok with just porting to UI tests for now and seeing if we have a problem, tho</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>